The present invention relates to an image processing apparatus and method and, for example, to an image processing method for determining binarization threshold values on the basis of a multi-valued image and performing binarization.
In recent years, image processing techniques have advanced remarkably, and image processing apparatuses which can perform processing of multi-valued images such as full-color images, character recognition processing in multi-valued images, and the like have become popular.
In such image processing techniques, binarization processing of multi-valued images is an indispensable technique. As conventional binarization methods, a simple binarization method based on a predetermined fixed threshold value, the Otsu's method which determines a binarization threshold value corresponding to the maximum inter-class variance obtained when the histogram is divided into two classes based on a certain threshold value (Otsu, "Automatic Threshold Value Selection Method Based on Discrimination and Least Square Criteria", Journal of Papers of The Institute of Electronics, Information and Communication Engineers, vol. J63-D, No. 4, pp. 349-356, 1980), a binarization method for setting the threshold values in correspondence with the local densities in a gradation image, and the like, are known.
In the simple binarization method based on a fixed threshold value, it is difficult to set an appropriate threshold value between the object density and the background density in an image, and as a consequence, the entire image is battered in black or white. On the other hand, in the Otsu's method, when the distributions of the two classes are extremely different from each other, the threshold value tends to be offset to the larger class of the two, thus generating a binary image with many noise components.
The above-mentioned problem is similarly posed when an original image including both picture and character portions is to be binarized. In the simple binarization method based on a fixed threshold value, it is difficult to set a threshold value suitable for both the picture and character portions. As a consequence, if the threshold value is preferentially determined for the picture portion, the character portion is battered. On the other hand, when the threshold value is preferentially determined for the character portion, the picture portion is battered or blurred. In the Otsu's method, when the picture and character portions have different features in the distributions of the two classes, and the distributions of the two classes are extremely different from each other, the threshold value tends to be offset to the larger class of the two and, hence, a binary image including many noise components is generated. Furthermore, in the binarization method that sets the threshold value in correspondence with the local density, when a character portion is present on the background, even the background is reproduced to have density, and a binary image which includes many noise components in the character portion is generated.
Conventionally, the numeric operation method on a computer includes an integer operation and a floating-point operation. The integer operation is executed at high speed within the integer effective number range (from 32767 to -32768 for 16-bit integers) that can be processed by a computer, and is executed at higher speed within the internal integer effective number range (this depends on the processing environment such as a CPU, system, and the like) of the computer. On the other hand, since the floating-point operation is executed using numbers having a mantissa and an exponent, it can express various numbers from large numbers to decimal fractions.
Also, upon constituting an operational block using an operational circuit in place of computation by means of a computer program, a method of constituting such block using a floating-point operational circuit, and a method of constituting such block using an integer operational circuit are available.
However, the numeric operation method used upon determining binarization threshold values in the above-mentioned numeric operation apparatus for image processing has the following problems.
When a numeric operation for image processing is performed by the integer operation, the operation speed is greatly higher than that in the floating-point operation. However, errors are generated since the decimal part is rounded off in, e.g., a division, and such errors are apt to accumulate when repetitive arithmetic operations include a division. As a consequence, high precision cannot be maintained. Also, the integer range is limited; the integer operation cannot process a large number beyond the range and a decimal fraction.
When a numeric operation for image processing is attained by the floating-point operation, high precision can be maintained, but the arithmetic operation speed is low, resulting in a long processing time. Since quite a few CPUs have no floating-point operational units, the processing time is further prolonged when such CPU is used.
In the arithmetic operation attained by hardware, when the floating-point operational circuit is used, the arithmetic operation speed is low and a large circuit scale is required. On the other hand, when the integer operational circuit is used, arithmetic operation errors due to rounding off are enhanced.
The floating-point operation always requires an operation for normalizing the mantissas of the numbers to equalize the exponents. This operation requires a considerably high clock rate in addition/subtraction although it does not require such high clock rate in multiplication/division. If this operation is executed by a low clock rate, the hardware scale increases. In contrast to this, the integer operation or fixed-point number operation suffers problems of overflowing and low arithmetic operation precision due to rounding errors. In order to obtain high arithmetic operation precision equivalent to that in the floating-point operation by the integer operation, the number of digits of an operational circuit can only be increased, and in such case, an increase in hardware scale or a decrease in operating frequency cannot be avoided.